package com.heima.search.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.search.pojos.HistorySearchDto;
import com.heima.search.service.ApUserSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author DiXiaoNie
 * @since 2023/1/2 17:37
 */
@RestController
@RequestMapping("/api/v1/history")
public class HistoryController {
    @Autowired
    private ApUserSearchService apUserSearchService;

    /**
     * 查找
     *
     * @return {@link ResponseResult }
     * @author DiXiaoNie
     * @date 2023/01/02
     */
    @PostMapping("/load")
    public ResponseResult load() {
        return this.apUserSearchService.load();
    }

    /**
     * 删除
     *
     * @param dto dto
     * @return {@link ResponseResult }
     * @author DiXiaoNie
     * @date 2023/01/02
     */
    @PostMapping("/del")
    public ResponseResult del(@RequestBody HistorySearchDto dto) {

        return this.apUserSearchService.del(dto);
    }
}
